package cn.angis;


import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;
import org.beetl.sql.core.SQLManagerBuilder;
import org.noear.solon.Solon;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.scheduling.annotation.EnableAsync;
import org.noear.solon.scheduling.annotation.EnableScheduling;
import org.noear.solon.serialization.snack3.SnackStringSerializer;

/**
 * 启动器
 * @author angis.cn
 *
 */
@EnableAsync
@EnableScheduling
@SolonMain
public class AngisApp {

	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		IdGeneratorOptions options = new IdGeneratorOptions((short) 9);
		options.SeqBitLength = 12;
		YitIdHelper.setIdGenerator(options);

		Solon.start(AngisApp.class, args, app -> {
            app.onEvent(SQLManagerBuilder.class, c -> {
//			启用开发或调试模式（可以打印sql）
                if (Solon.cfg().isDebugMode()) {
					c.addInterDebug();
                }
            });
			//启用 WebSocket 服务
//			app.enableWebSocket(true);
		});
		long times = System.currentTimeMillis() - start;
		System.out.println("✺◟(ԾᴗԾ)◞✺  茶饭启动成功，耗时:【" + times + "ms】  ˙˚ʚ(o◡Ô)ɞ˚˙");
//		System.out.println(VaultUtils.encrypt("start"));
	}
}